package com.ngds.library.downloadcenter;

import java.io.Serializable;

/**
 * DownloadBytesAndStatusWrapper
 * Description:下载状态
 * Author:walker lx
 * Date :14-5-14
 */
public class DownloadBytesAndStatusWrapper implements Serializable{
	private static final long serialVersionUID = 1L;
	private int downloadBytes;
    private int totalBytes;
    private int downloadStatus;

    public DownloadBytesAndStatusWrapper(int downloadBytes, int totalBytes, int downloadStatus) {
        this.downloadBytes = downloadBytes;
        this.totalBytes = totalBytes;
        this.downloadStatus = downloadStatus;
    }

    public int getDownloadBytes() {
        return downloadBytes;
    }

    public void setDownloadBytes(int downloadBytes) {
        this.downloadBytes = downloadBytes;
    }

    public int getTotalBytes() {
        return totalBytes;
    }

    public void setTotalBytes(int totalBytes) {
        this.totalBytes = totalBytes;
    }

    public int getDownloadStatus() {
        return downloadStatus;
    }

    public void setDownloadStatus(int downloadStatus) {
        this.downloadStatus = downloadStatus;
    }

    public boolean isProgressInPending() {
        return downloadStatus == AppDownloadManager.STATUS_PENDING;
    }

    public boolean isProgressInRunning() {
        return downloadStatus == AppDownloadManager.STATUS_RUNNING;
    }

    public boolean isProgressFailed() {
        return downloadStatus == AppDownloadManager.STATUS_FAILED;
    }

    public boolean isProgressPaused() {
        return downloadStatus == AppDownloadManager.STATUS_PAUSED;
    }

    public boolean isProgressSuccessed() {
        return downloadStatus == AppDownloadManager.STATUS_SUCCESSFUL;
    }


    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("downloadedBytes is " + downloadBytes)
            .append("\r\ntotalBytes is " + totalBytes)
            .append("\r\ndownloadStatus is " + downloadStatus);
        return sb.toString();
    }
}
